<?php

namespace IDock\Insurance\ZSIC\Request;

use Exception;
use IDock\Insurance\ZSIC\Request\AllZSICRequest;
use IDock\Insurance\ZSIC\Response\RenewalInquiryResponse;
use IDock\Visitor\RenewalInquiryVisitor;

class RenewalInquiryRequest extends AllZSICRequest
{
    public $requestCode = 'policyInfoQuery';

    protected $response = RenewalInquiryResponse::class;

    protected $urlTip = '续保查询';

    /*** @var  RenewalInquiryVisitor $visitor */
    protected $visitor;

    /**
     * @return array
     * @throws Exception
     */
    public function generate(): array
    {
        $this->channelCode = $this->visitor->argc['channelCode'] ?? '';
        $this->cityCode = $this->visitor->argc['cityCode'] ?? '';

        $param = [
            'base' => [
                'policyNo' => '',
                'licenseNo' => $this->visitor->licenseNo,//
                'frameNo' => $this->visitor->vin,//车架号
                'idNumber' => '',//车主证件号
            ]
        ];
        return $param;
    }

    public function getBusinessNo()
    {
        return $this->visitor->argc['businessNo'] ?? '';
    }
}
